package a30_PolymorphicCase;

/**
 * @Author quan
 * @Description 多态小案例:方法中有参数传入
 * @Date 2023/3/9 14:17
 */
public class TestDemo {
    public static void main(String[] args) {
        Person p1 = new Person("小A",23);
        Person p2 = new Person("小B",19);

        Animal animal1 = new Dog("金色",2);
        Animal animal2 = new Cat("灰色",1);

        p1.keepPet(animal1,"骨头");
        p2.keepPet(animal2,"小鱼干");
    }
}
